﻿using Caliburn.Micro;
using KouDai.WinPad.Controls;
using System;

namespace KouDai.WinPad.Models
{
    public class HoneyEntity : PropertyChangedBase, IResize
    {
        #region Fields
        private bool isPreference;
        private bool isOffline;
        private bool isChecked;
        private string _price;
        #endregion

        #region Constructor
        public HoneyEntity()
        {
            this.ImgRatio = 1.0;
            this.Margin = "0,0,0,0";
        }
        #endregion

        #region Properties

        /// <summary>
        /// 图片地址
        /// </summary>
        public string Url { get; set; }
        /// <summary>
        /// 图片高宽比
        /// </summary>
        public double ImgRatio { get; set; }
        /// <summary>
        /// 宝贝编号
        /// </summary>
        public string ID { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 价格
        /// </summary>
        public string Price
        {
            get { return _price; }
            set
            {

                _price = value;
            }
        }
        /// <summary>
        /// 售完
        /// </summary>
        public string Soldout { get; set; }
        /// <summary>
        /// 是否缓存
        /// </summary>
        public bool IsCache { get; set; }
        /// <summary>
        /// 收藏数
        /// </summary>
        public int FaviorateAmout { get; set; }

        /// <summary>
        /// 所在页的标记，记录了此标记并在页面空间中绑定过了次标记便可以用图片墙revoke机制
        /// </summary>
        public string PageNo { get; set; }

        public string PageToken { get; set; }

        /// <summary>
        /// 我的街
        /// </summary>
        public string Am { get; set; }
        public string RequestID { get; set; }
        public string TokenID { get; set; }
        public string ImageUrlForIphone { get; set; }
        public Int64 Timestamp { get; set; }
        /// <summary>
        /// 排行榜序号
        /// </summary>
        public int Num { get; set; }

        #endregion

        #region NotifyProperties

        /// <summary>
        /// 是否特惠
        /// </summary>
        public bool IsPreference
        {
            get { return isPreference; }
            set
            {
                if (isPreference != value)
                {
                    isPreference = value;
                    this.NotifyOfPropertyChange(() => this.IsPreference);
                }
            }
        }

        /// <summary>
        /// 是否已下架
        /// </summary>
        public bool IsOffline
        {
            get { return isOffline; }
            set
            {
                if (isOffline != value)
                {
                    isOffline = value;
                    this.NotifyOfPropertyChange(() => this.IsOffline);
                }
            }
        }


        /// <summary>
        /// 是否已选取删除标记
        /// </summary>
        public bool IsChecked
        {
            get { return isChecked; }
            set
            {
                if (isChecked != value)
                {
                    isChecked = value;
                    this.NotifyOfPropertyChange(() => this.IsChecked);
                }
            }
        }
        #endregion

        public string ColorStr { get; set; }

        public string Margin { get; set; }
        public double Height { get; set; }
        public double Width { get; set; }

        public double ColSpan { get; set; }
        public double RowSpan { get; set; }
    }
}
